package design.pattern.Decorator.instance;

import design.pattern.Decorator.inter.BasicDecorator;
import design.pattern.Decorator.inter.impl.WrapperHandleDecorator;

public class EatHandleDecorator extends WrapperHandleDecorator<String> {
  public EatHandleDecorator(BasicDecorator<String> decorator) {
    super(decorator);
  }
  
  private void beforeHandle() {
    System.out.println("我要洗手");
  }
  
  private void afterHandle() {
    System.out.println("我要洗碗");
  }
  
  /**
   * 从 此方法中 进行装饰器扩展
   *
   * @param data 传递的数据
   * @author lihh
   */
  @Override
  public void operate(String data) {
    this.beforeHandle();
    super.operate(data);
    this.afterHandle();
  }
}
